<include file="Public:js" /> 
<div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="#">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">平台商品列表</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="qr_listc" method="post">
                    <table class="search-tab">
                        <tr>
                           
                            
                            <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
           
                <div class="result-title">
                    <div class="result-list">
                       <a href="javascript:;"><i class="icon-font"></i>新增</a>
                        <a id="batchDel" href="javascript:;"><i class="icon-font"></i>批量删除</a>
                    </div>
                </div>
                <div class="result-content">
                    <form method="post" action="" id="list">
                    <table class="result-tab" width="100%">
                        <tr>
                            <!--<th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>-->
                            <th><input type="checkbox" id="all" name="checkall"/> 编号</th>
                            <th>商品名称</th>
                            <th>货号</th>
                            <th>价格</th>
                            <th>排序</th>
                            <th>库存</th>
                            
                            
                            <th>操作</th>
                        </tr>

                        <foreach name="data" item="ov"> 
                        <tr>
                            <!--<td class="tc"><input name="id[]" value="59" type="checkbox"></td>-->
                            <td><input type="checkbox" value="{$ov.goods_id}" />{$ov.goods_id}</td>
                            <td>{$ov.goods_name} </td>
                            <td>{$ov.goods_sn} </td>
                           <td>{$ov.shop_price}</td>
                            <td>{$ov.sort_order}</td>
                            <td>{$ov.goods_number}</td>    
                            <td>
                                <a class="link-show" data="{$ov.goods_id}" href="javascript:;">查看</a>
                                <!-- <a class="link-del" href="{:U('Fangwei/addInfo',array('goods_id'=>$ov['goods_id'],'cat_id'=>$ov['cat_id']))}">基本信息</a> -->
                                <a class="link-update" href="{:U('Fangwei/addFujiaInfo',array('goods_id'=>$ov['goods_id'],'cat_id'=>$ov['cat_id']))}" >
                                    具体信息
                                </a>
                                <a class="link-update" href="{:U('Qrcode/creatQr',array('goods_id'=>$ov['goods_id'],'cat_id'=>$ov['cat_id']))}" >
                                    生成二维码
                                </a>
                                 <a class="link-update" href="{:U('Goods/lunbo',array('goods_id'=>$ov['goods_id']))}" >
                                    添加轮播图
                                </a>
                            </td>
                        </tr>
                        </foreach> 
                        
                    </table>
                </form>
                    <div class="list-page">{$show}</div>
                </div>
          
        </div>
    </div>
<script type="text/javascript">
    $(function(){
        $('#all').on('click',function(){
        var fm=document.getElementById('list');
        //form.elements获取表单内的所有表单
        for(var i=0;i<fm.elements.length;i++){
            if(fm.elements[i]!='checkall'){
                fm.elements[i].checked=fm.checkall.checked;
                }
            }
        
        });
    $('#batchDel').on('click',function(){
        var idObj=$(':checkbox:checked'); //获取全部已经被选中的checkbox
        var ids='';  //接收处理后的部门id的值
        //循环遍历idObj
        for(var i=0;i<idObj.length;i++){
            ids+=idObj[i].value+',';
            }
        //去掉最后的逗号
        ids=ids.substring(0,ids.length-1);
        //带着参数跳转到del方法
        alert(ids);
        //window.location.href='__CONTROLLER__/del/ids/'+ids;
        });
    $('.link-show').on('click',function(){
       var id=$(this).attr('data');
       window.location.href='__CONTROLLER__/show_detail/id/'+id; 
    }); 
    });
</script>